﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Xml.XPath;
using System.Xml.Serialization;


namespace Transformer.iHunter
{

    /// <summary>
    /// Present the interface of the channel provider, which creates channels
    /// </summary>
    public interface IChannelProvider : IPlugin
    {

        /// <summary>
        /// Creates the channel instance.
        /// </summary>
        /// <param name="info">The channel info.</param>
        /// <returns>The instance of the channel object</returns>
        IChannel CreateChannelInstance(ChannelInfo info);


        /// <summary>
        /// Gets the channel configure editor.
        /// </summary>
        /// <returns>The configure editor.</returns>
        /// <remarks>
        /// A configure editor is a Windows Forms user control <see cref="System.Windows.Forms.UserControl"/> 
        /// and it must implement <see cref="System.Xml.Serialization.IXmlSerializable"/> interface.
        /// The user control will be shown while the user editing the settings of a channel provided by this channel provider.
        /// The <see cref="System.Xml.Serialization.IXmlSerializable"/> interface is used to set and retreive settings
        /// from the editor control.
        /// </remarks>
        UserControl GetChannelConfigureEditor();

        /// <summary>
        /// Gets the instance creating wizard pages.
        /// </summary>
        /// <returns>The wizard pages array</returns>
        /// <remarks>
        /// A wizard page is a <see cref="System.Windows.Forms.UserControl"/> object
        /// and it must implement <see cref="System.Xml.Serialization.IXmlSerializable"/> interface.
        /// The pages will be shown one by one while the user using creating a new channel using the creating wizard.
        /// The <see cref="System.Xml.Serialization.IXmlSerializable"/> interface is used to set and retreive settings
        /// from the editor control. The settings of each page will be retrieved and passed to the next page (if exists).
        /// When the last page is closed (the user clicks "Finish"), the settings will be saved in the database
        /// </remarks>
        UserControl[] GetNewChannelWizardPages();

        /// <summary>
        /// Gets the messsage editor provider GUID for new messages.
        /// </summary>
        /// <value>The new messsage editor GUID.</value>
        Guid NewMesssageEditorGuid { get; }

    }
}
